<template>
  <div class="featrue-properties-bar-ontainer" v-if="visible">
    <div class="properties-title" v-if="title">{{ title }}</div>
    <ul class="properties-list">
      <li class="properties-list-item" v-for="(e, k) in properties" :key="k">
        <div class="text-cut">{{ k }}</div>
        <div class="text-cut">{{ e }}</div>
      </li>
    </ul>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';
export default defineComponent({
  name: 'feature-properties',
  props: {
    title: {
      type: String,
      default: ''
    },
    properties: {
      type: Object,
      default() {
        return {};
      }
    },
    visible: {
      type: Boolean,
      default: false
    }
  },
  computed: {},
  methods: {}
});
</script>

<style lang="less">
.featrue-properties-bar-ontainer {
  position: absolute;
  right: 0;
  top: 36%;
  width: 22em;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 99;

  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;

  .properties-title {
    width: 100%;
    display: flex;
    line-height: 2.4em;
    align-items: center;
    // justify-content: center;
    margin: 0;
    padding: 0 0 0 1em;
  }

  .properties-list {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0 0 10px 0;

    font-size: 13px;

    .properties-list-item {
      display: flex;
      line-height: 1.5em;
      padding: 0;

      border-bottom: 1px solid rgba(255, 255, 255, 0.1);

      &:first-child {
        border-top: 1px solid rgba(255, 255, 255, 0.1);
      }

      & > div {
        margin: 0;
        padding: 5px 10px 5px 10px;
        &:first-child {
          width: 10em;
          background-color: rgba(255, 255, 255, 0.05);
        }
      }
    }
  }
}
</style>
